/*
 * (C) Copyright 1997-2002 ELTEC Elektronik AG
 * Frank Gottschling <fgottschling@eltec.de>
 *
 * See file CREDITS for list of people who contributed to this
 * project.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of
 * the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 * MA 02111-1307 USA
 */

/*
 * smiLynxEM.h
 * Silicon Motion graphic interface for sm810/sm710/sm712 accelerator
 *
 *
 *  modification history
 *  --------------------
 *  04-18-2002 Rewritten for U-Boot <fgottschling@eltec.de>.
 */

#ifndef _VIDEO_FB_H_
#define _VIDEO_FB_H_

/*
 * Graphic Data Format (GDF) bits for VIDEO_DATA_FORMAT
 */
#define GDF__8BIT_INDEX         0
#define GDF_15BIT_555RGB        1
#define GDF_16BIT_565RGB        2
#define GDF_32BIT_X888RGB       3
#define GDF_24BIT_888RGB        4
#define GDF__8BIT_332RGB        5

/******************************************************************************/
/* Export Graphic Driver Control                                              */
/******************************************************************************/

typedef struct {
    void        *frameAdrs;
    unsigned int gdfIndex;
    unsigned int gdfBytesPP;
    unsigned int winSizeX;
    unsigned int winSizeY;
} GraphicDevice;

#define RGB888toRGB565(rgb)  (u16)(((((rgb)>>19)&0x1f)<<11) | ((((rgb)>>10)&0x3f)<<5) | (((rgb)>>3)&0x1f))

#define BLACK_24_32BIT       (u32)0x0
#define BLUE_24_32BIT        (u32)0xFF
#define GREEN_24_32BIT       (u32)0xFF00
#define CYAN_24_32BIT        (u32)0xFFFF
#define RED_24_32BIT         (u32)0xFF0000
#define MAGENTA_24_32BIT     (u32)0xFF00FF
#define YELLOW_24_32BIT      (u32)0xFFFF00
#define WHITE_24_32BIT       (u32)0xFFFFFF
#define BIOS_WHITE_24_32BIT  (u32)0xADAAAD

/*********************************************************************************************************
  Standard RGB 1bit color
*********************************************************************************************************/
#define TEXT_BLACK          0
#define TEXT_BLUE           1
#define TEXT_GREEN          2
#define TEXT_CYAN           3
#define TEXT_RED            4
#define TEXT_MAGENTA        5
#define TEXT_YELLOW         6
#define TEXT_WHITE          7
#define TEXT_BIOS_WHITE     8

#endif /*_VIDEO_FB_H_ */
